Get file date

Hello all,

is there a possibility to read out the create / modified date of a logfile (txt file on hdd) by using dxl?

 

Regards

Chris


leporello - Mon Feb 09 05:08:41 EST 2015

Re: Get file date
Mathias Mamsch - Mon Feb 09 06:24:14 EST 2015

Create not out of the box. Modify yes. Check out the "Stat" type in the DXL help. For create you probably would need to settle for calling a Commandline tool or use COM. Regards, Mathias

Re: Get file date
Wolfgang Uhr - Mon Feb 09 06:31:20 EST 2015

Hi

You can use the FSO for this task.

a) Create the object reference one time

OleAutoObj objFso = oleCreateAutoObject("Scripting.FileSystemObject");
OleAutoArgs objArgs = create();

b) Call a method of that object

/**************************************************************/
/** Checkt, ob eine Datei exisitert 
***************************************************************/
bool isExistingFile(string sFileName) {
    bResult = false;
 clear(objArgs)
 put (objArgs, "FileSpec", sFileName);
 showErrorMessage(oleMethod(objFso, "FileExists", objArgs, bResult));
 return (bResult);
}

You have to get a file reference and call the get method for the date you need and actually I've no example.

Best regards

Wolfgang

Re: Get file date
leporello - Mon Feb 09 08:39:59 EST 2015

Ok, thanks for the hints guys!! That helps.

Regards

Chris